<!--
  @Description:注册
  @author Wangshu
  @date 2019/8/17
-->

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="__PUBLIC__/css/signIn.css">
    <link rel="stylesheet" href="__PUBLIC__/css/common/common.css">
    <link rel="stylesheet" href="__PUBLIC__/css/common/swiper.min.css">
    <title>山东科技大学技术转移公共服务平台-登录</title>
</head>
<style>
    .captcha {
        max-width: none !important;
    }
</style>
<body>
<div class="header flex a-center">
    <img src="__PUBLIC__/asset/fodder/logo.png" alt="">
    <div class="line"></div>
    <div>登录</div>
</div>
<div class="content">
    <div class="window hp100 flex rcb">
        <div class="slogan"><img src="__PUBLIC__/asset/fodder/slogan.png" alt=""></div>
        <div class="s-window">
            <div class="title">
                <p>欢迎登录</p>
                <p>山科大技术转移公共服务平台</p>
            </div>

            <div class="search">
                <div class="dropdown">
                    账号
                </div>
                <div class="search-block">
                    <input type="text" name="account" id="account">
                </div>
            </div>
            <div class="search">
                <div class="search-block">
                    <input type="password" name="password" id="password" placeholder="请输入密码">
                </div>
            </div>
            <div class="flex a-center">
                <div class="search auth">
                    <div class="search-block">
                        <input type="text" name="code" id="code" placeholder="验证码">
                    </div>
                </div>
                <div class="search code">
                    <img class="captcha" src="{:captcha_src()}" id="captcha"
                         onclick="this.src='{:captcha_src()}?seed='+Math.random()" height="45" width="150"
                         alt="captcha"/>
                </div>
            </div>
            <div class="forget flex">
                <span><a href="{:url('login/forgetpwd')}">忘记密码?</a></span>
                <span><a href="./signUp.html">立即注册</a></span>
            </div>
            <div class="button" id="submit">
                立即登录
            </div>
        </div>
    </div>
</div>
<div class="footer flex a-center ">
    <div>Copyright©2019 　山东科技大学</div>
    <div style="color:#bebebe; margin-left:20px;">鲁ICP备09091012号</div>
    <span style="line-height: 26px ; margin-left: 20px;"><img
            style="width: 44px;height: 17px; margin-right: 10px;vertical-align: middle"
            src="__PUBLIC__/asset/fodder/todo_black.png" alt=""><span
            style="vertical-align: middle">投道科技提供技术支持</span></span>
</div>
<script src="__PUBLIC__/js/public/jquery-1.11.3.min.js"></script>
<script src="__PUBLIC__/js/public/swiper.min.js"></script>
<script src="__PUBLIC__/js/public/bootstrap.min.js"></script>
<script src="__PUBLIC__/js/layer/layer/layer.js"></script>
<script>
    $("#submit").on('click', function () {
        const account = $("#account").val();
        const password = $("#password").val();
        const code = $("#code").val();
        $.post("{:url('doLogin')}", {account, password, code}, function (res) {
            console.log(res)
            if (res.code === 1) {
                window.location.href = "{:url('/index')}"
            } else {
                $(".captcha").attr('src', '{:captcha_src()}?seed=' + Math.random())
                layer.msg(res.msg, {}, function () {
                    return false
                })
            }
        })
    })
</script>
</body>
</html>
